

import bpy
import nodeitems_utils
from bpy.types import Operator, Menu



'''
class C_选择修改器项(Operator):
	bl_idname = "node.object_modifiers_set_selete"
	bl_label = "Add Object Draw Preset"

	m_修改器类型 = bpy.props.StringProperty(default='')
	def execute(self, context):
		#node_group = bpy.data.node_groups[self.m_节点树ID名称]
		#node = node_group.nodes[self.m_节点ID名称]
		print(self, self.name, self.m_修改器类型)
		return {'FINISHED'}
'''

class C_节点子菜单_修改器选择菜单(Menu):
	bl_label = "修改器"
	bl_idname = "node.enum_object_modifiers"
	#preset_subdir = "object/draw"
	#draw = Menu.draw_preset

	def draw(self, context):
		layout = self.layout
		列布局 = layout.row()
		行布局 = 列布局.column()
		行布局.label(text='修改')
		行布局.operator("node.global_node_obj_modifiers_uvproject", text='UV Project') #.m_修改器类型 = 'UV Project'
		
		行布局.operator("node.global_node_obj_modifiers_particle", text='粒子')
		行布局.operator("node.global_node_obj_remove_modifier", text='移除修改器')

		行布局.separator()
		行布局.operator("node.global_node_obj_parameter_track_to", icon='CON_TRACKTO')
		行布局.operator("node.global_node_obj_set_constraints_track_to", icon='CON_TRACKTO')
		

		行布局.separator()
		#new
		行布局.operator("node.global_node_obj_modifiers_solidify", text='厚度')
		行布局.operator("node.global_node_obj_modifiers_bevel", text='切角')
		

		行布局.separator()
		行布局.operator('node.global_node_set_bl_particle_data', text='设置粒子数据')
		

		
		行布局.separator()
		行布局.operator("node.global_node_obj_modifiers_smoke", text='烟雾修改器', icon='MOD_SMOKE')
		行布局.operator('node.global_node_obj_modifiers_mesh_array', icon='MOD_ARRAY')
		行布局.operator('node.global_node_obj_modifiers_mesh_split', text='网格分割', icon='MOD_DISPLACE')
		

		行布局.separator()
		行布局.operator('node.global_node_obj_constraints_transformation', text='自设变换')
		#行布局.operator('node.global_node_set_bl_particle', icon='PARTICLE_DATA')
		
		


class C_节点子菜单_物体编辑(Menu):
	bl_idname = "node.enum_object_edit"
	bl_label = "物体编辑"

	def draw(self, context):
		layout = self.layout
		layout.operator('node.global_node_particle_prop_keyframe_insert')
		layout.operator('node.global_node_particle_prop_keyframe_clear')
		layout.operator('node.global_node_set_obj_translation')
		layout.operator('node.global_node_set_obj_attr_insert_frame')
		layout.operator('node.global_node_obj_relations')
		#layout.operator('node.global_node_set_objects_mesh')
		layout.operator('node.global_node_set_object_properties')
		layout.operator('node.global_node_set_obj_apply_translation')
		layout.operator('node.global_node_set_install_material')
		
		layout.separator()

		
		#new
		#layout.separator()
		#layout.operator('node.global_node_set_object_mesh', icon='MESH_DATA')
		#layout.operator('node.global_node_get_object_transform', icon='OBJECT_ORIGIN')
		#layout.operator('node.global_node_set_object_transform', icon='ORIENTATION_GLOBAL')

		layout.separator()
		layout.operator('node.mesh_member_expansion', icon='ALIGN_LEFT')
		layout.operator('node.mesh_member_merger', icon='ALIGN_RIGHT')
		#layout.menu('node.enum_object_modifiers')
		



class C_节点子菜单_材质编辑(Menu):
	bl_idname = "node.enum_material_edit"
	bl_label = "材质编辑"

	def draw(self, context):
		layout = self.layout
		layout.operator('node.global_node_set_material_texture_node')
		


classes = (
	C_节点子菜单_修改器选择菜单,

	C_节点子菜单_物体编辑,
	C_节点子菜单_材质编辑,

)

def register():
	for c in classes:
		bpy.utils.register_class(c)

def unregister():
	for c in classes:
		bpy.utils.unregister_class(c)

	



